//输入某年某月某日，判断这一天是这一年的第几天？
#include<stdio.h>
int main(){
    const int daysInMonth[]={31,28,31,30,31,30,31,31,30,31,30,31};
    int year,mon,day,sum;
    printf("请输入年月日：（年.月.日）");
    if(scanf("%d.%d.%d",&year,&mon,&day)!=3||mon<1||mon>12||day<1||day>31){
        printf("输入错误\n");
        return 1;
    }
    sum=0;
    for(int i=0;i<mon;i++){
        sum+=daysInMonth[i];
    }
    sum+=day;
    int leap=(year%400==0)||(year%4==0&&year%100!=0);
    if(leap&&mon>2){
        sum++;
    }
    printf("是这一年的第%d天\n",sum);
    return 0;
}